import request from '@/config/axios'

// 话术库关键字 VO
export interface TemplateKeyInfoVO {
  id: number // 话术id
  name: string // 关键字 key
  info: string // 关键字 value
}

// 话术库关键字 API
export const TemplateKeyInfoApi = {
  // 查询话术库关键字分页
  getTemplateKeyInfoPage: async (params: any) => {
    return await request.get({ url: `/system/template-key-info/page`, params })
  },

  // 查询话术库关键字详情
  getTemplateKeyInfo: async (id: number) => {
    return await request.get({ url: `/system/template-key-info/get?id=` + id })
  },

  // 新增话术库关键字
  createTemplateKeyInfo: async (data: TemplateKeyInfoVO) => {
    return await request.post({ url: `/system/template-key-info/create`, data })
  },

  // 修改话术库关键字
  updateTemplateKeyInfo: async (data: TemplateKeyInfoVO) => {
    return await request.put({ url: `/system/template-key-info/update`, data })
  },

  // 删除话术库关键字
  deleteTemplateKeyInfo: async (id: number) => {
    return await request.delete({ url: `/system/template-key-info/delete?id=` + id })
  },

  // 导出话术库关键字 Excel
  exportTemplateKeyInfo: async (params) => {
    return await request.download({ url: `/system/template-key-info/export-excel`, params })
  },
}